﻿using System;

namespace FluentlyXml.Core
{
	public class CycleDetectedException : ApplicationException
	{
		public CycleDetectedException(Type type, object obj)
			:base(GetMessage(type, obj))
		{
		}

		private static string GetMessage(Type type, object obj)
		{
			return string.Format("Cycle detected while serializing object {0} as type {1}", obj, type);
		}
	}
}